import vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/views/Home'
import Recommend from '@/views/Home/Recommend'
import SongList from '@/views/Home/SongList'
import Top from '@/views/Home/Top'
import PlaylistDetail from '@/views/PlaylistDetail'



// 使用插件
vue.use(VueRouter)



export default new VueRouter({
    routes: [{
            path: '/home',
            component: Home,
            children: [{
                    path: 'recommend',
                    component: Recommend
                },
                {
                    path: 'songlist',
                    component: SongList
                },
                {
                    path: 'top',
                    component: Top
                },
            ],
            redirect: '/home/recommend'

        },
        {
            path: '/playlist/:id',
            component: PlaylistDetail
        },
        {
            path: '/',
            redirect: '/home'
        }
    ]
})